#include "GEnginePCH.h"
#include "Camera.h"


Camera::Camera(void)
{
}
Camera::~Camera(void)
{
}
void Camera::Init( const D3DXVECTOR3& cameraSource, const D3DXVECTOR3& cameraTarget, const D3DXVECTOR3& upDir)
{
	D3DXMatrixLookAtLH(&m_matView, &cameraSource, &cameraTarget, &upDir);
	vRot = D3DXVECTOR3(0.0f, 0.0f, 0.0f);
	//TODO: Sa calculez unghiurile de start calumea
}
D3DXMATRIX& Camera::GetMat()
{
	return m_matView;
}
void Camera::RotX( float angle )
{
	D3DXMATRIX matRotX;
	vRot.x += angle;
	D3DXMatrixRotationX(&matRotX, angle);
	D3DXMatrixMultiply(&m_matView, &m_matView, &matRotX);
}
void Camera::RotY( float angle )
{
	D3DXMATRIX matRotY;
	vRot.y += angle;
	D3DXMatrixRotationY(&matRotY, angle);
	D3DXMatrixMultiply(&m_matView, &m_matView, &matRotY);
}
void Camera::RotZ( float angle )
{
	D3DXMATRIX matRotZ;
	vRot.z += angle;
	D3DXMatrixRotationZ(&matRotZ, angle);
	D3DXMatrixMultiply(&m_matView, &m_matView, &matRotZ);
}